﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using ATCAssistant.Properties;

namespace ATCAssistant
{
    public partial class SettingsDialog : Form
    {
        public SettingsDialog()
        {
            InitializeComponent();
        }

        private void cmdBrowseDataFolder_Click(object sender, EventArgs e)
        {
            FolderBrowserDialog dlg = new FolderBrowserDialog();
            dlg.RootFolder = Environment.SpecialFolder.UserProfile;
            if (dlg.ShowDialog() == DialogResult.OK)
            {
                txtDataFolderPath.Text = dlg.SelectedPath;
            }
        }

        private void cmdOk_Click(object sender, EventArgs e)
        {
            Settings.Default.DataFolderPath = txtDataFolderPath.Text;
            Settings.Default.Save();
            this.DialogResult = DialogResult.OK;
        }

        private void cmdCancel_Click(object sender, EventArgs e)
        {
            this.DialogResult = DialogResult.Cancel;
        }

        private void SettingsDialog_Load(object sender, EventArgs e)
        {
            txtDataFolderPath.Text = Settings.Default.DataFolderPath;
        }
    }
}
